package com.hypertech.core.ffmpeg.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PageController {

    @RequestMapping("/show")
    public String video(){
        return "show";
    }
    @RequestMapping("/{value}")
    public String page(@PathVariable String value){
        return value;
    }
    @RequestMapping("/videojs/{val}")
    public String show(@PathVariable String val){
        return "videojs/"+val;
    }
    @RequestMapping("/showVideo")
    public String showVideo(String id, Model model){
        model.addAttribute("videoName","/media/"+id+".mp4");
        model.addAttribute("imgName","/media/"+id+".jpg");
        return "videojs/index";
    }
}
